import tkinter as tk
from tkinter import messagebox


class application(tk.Frame):
    def __init__(self,master=None):
        self.master=master
        super().__init__(master)
        self.creatWidget()

    def creatWidget(self):
        self.v1=tk.IntVar()
        self.v1.set(10)
        self.s=tk.Scale(self.master,from_=10,to=100,tickinterval=5,width=20,length=1000,orient=tk.HORIZONTAL,command=self.optionFont)
        self.s.pack()

        self.l=tk.Label(self.master,text=f"字体大小:14",font=("Arial",14))
        self.l.pack()

    def optionFont(self,value):
        self.v1.set(value)
        newFont=('Arial',value)
        self.l.config(font=newFont,text=f'字体大小:{self.v1.get()}')


window=tk.Tk()
app=application(window)
window.mainloop()